package ph.com.gs3.chat.model.valueobject.business;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class UserStub implements Serializable {

	private static final long serialVersionUID = -5491863749621280979L;

	private String id;
	private String displayName;
	private String imageURL;

	private static final class WEB_KEY {
		public static final String ID = "id";
		public static final String DISPLAY_NAME = "displayName";
		public static final String IMAGE_URL = "imageURL";
	}

	public static final UserStub createFromJSON(JSONObject rawUserStub) throws JSONException {

		UserStub userStub = new UserStub();

		userStub.setId(rawUserStub.getString(WEB_KEY.ID));
		userStub.setDisplayName(rawUserStub.getString(WEB_KEY.DISPLAY_NAME));
		userStub.setImageURL(rawUserStub.getString(WEB_KEY.IMAGE_URL));

		return userStub;

	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getImageURL() {
		return imageURL;
	}

	public void setImageURL(String imageURL) {
		this.imageURL = imageURL;
	}

}
